/**
 *  @file collisionDetector.h
 *
 *  @date 19-nov-2009
 *  @author Ives van der Flaas
 */

#ifndef COLLISIONDETECTOR_H_
#define COLLISIONDETECTOR_H_

#include <tr1/memory>
#include "boundingBox.h"
#include "ship.h"
namespace si
{
/**
 * This class will be used to see if there's a collision between
 * two objects. This cannot be done by the objects themselves, since
 * there can be more than one type of boundingbox in the game at any
 * time!
 */
class CollisionDetector
{
public:


	/**
	 * Returns true if Ship A shot Ship B.
	 * @param a The first ship
	 * @param b The seconds ship
	 * @param damage Returns the amount of damage the bullet did
	 * @param whichBullet Returns which bullet hit.
	 * @return
	 */
	bool aShotB(std::tr1::shared_ptr<Ship > a, std::tr1::shared_ptr<Ship > b, int& damage, int& whichBullet);

private:
	bool collision(std::tr1::shared_ptr<BoundingBox> b1, std::tr1::shared_ptr<BoundingBox> b2) const;
};

}

#endif /* COLLISIONDETECTOR_H_ */
